<template>
  <div class="avue-logo">
    <transition name="fade">
      <div v-if="keyCollapse" class="avue-logo_subtitle" key="0">
        <img :src="website.logo" style="width: 24px;height: 24px" />
      </div>
    </transition>
    <transition-group name="fade">
      <template v-if="!keyCollapse">
        <div class="avue-logo_title" key="1">
          <img :src="website.logo" style="width: 30px;height: 30px" />
          <span>{{website.indexTitle}} </span>
        </div>
      </template>
    </transition-group>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  name: "logo",
  data() {
    return {};
  },
  created() {},
  computed: {
    ...mapGetters(["website", "keyCollapse"])
  },
  methods: {}
};
</script>

<style lang="scss">

.fade-leave-active {
  transition: opacity 0.2s;
}
.fade-enter-active {
  transition: opacity 2.5s;
}
.fade-enter,
.fade-leave-to {
  opacity: 0;
}
.avue-logo {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 64px;
  line-height: 64px;
  background-color: #20222a;
  font-size: 20px;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
  color: rgba(255, 255, 255, 0.8);
  z-index: 1024;
  display: flex;
  align-items: center;
  &_title {
    display: flex;
    align-items: center;
    font-weight: 300;
    font-size: 20px;
    padding: 0 16px;
    img {
      margin-right: 10px;
    }
  }
  &_subtitle {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 16px;
  }
}
</style>
